﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using SqlSugar;
using SzlsRobots.Common;

namespace SzlsRobots.Models
{
    /// <summary>
    /// 机器人工程表
    /// </summary>
    [SugarTable("project")]
    public class Project
    {
        /// <summary>
        /// 主键ID
        /// </summary>           
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "id")]
        public long Id { get; set; }

        /// <summary>
        /// 工程编号
        /// </summary>             
        [SugarColumn(ColumnName = "pnumber")]
        public string PNumber { get; set; }

        /// <summary>
        /// 信息编号
        /// </summary>             
        [SugarColumn(ColumnName = "inumber")]
        public string INumber { get; set; }

        /// <summary>
        /// 工程状态：进行中(Working)/完成(Finish)
        /// </summary>            
        [SugarColumn(ColumnName = "status")]
        public string Status { get; set; }

        [SugarColumn(ColumnName = "robots", ColumnDataType = "json", IsJson = true)]
        public List<Robots> Robots { get; set; } = new();

        /// <summary>
        /// 创建时间
        /// </summary>            
        [SugarColumn(ColumnName = "created", IsOnlyIgnoreUpdate = true)]
        public DateTime Created { get; set; } = DateTime.Now;

        /// <summary>
        /// 更新时间
        /// </summary>             
        [SugarColumn(ColumnName = "updated")]
        public DateTime Updated { get; set; } = DateTime.Now;

    }
}
